import request from '@/utils/request'

// 文件分片下载
export function chunkDownloadFile(query, range){
  return request({
    url: '/business/fileDownload/download',
    method: 'get',
    params: query,
    responseType: 'blob',
    headers: {
      range: range
    }
  })
}

// 获取分片url
export function getChunkUrl(chunkNum, fileName, filePath, contentType){
  return request({
    url: '/business/fileDownload/getChunkUrl',
    method: 'get',
    params: {chunkNum: chunkNum, fileName: fileName, filePath: filePath, contentType: contentType}
  })
}

// 文件合并
export function mergeFile(chunkNum,fileName,contentType,uploadId,fileMd5, filePath){
  return request({
    url: '/business/fileDownload/merge',
    method: 'get',
    params: {chunkNum: chunkNum,fileName: fileName,contentType: contentType, uploadId: uploadId, fileMd5: fileMd5, filePath: filePath}
  })
}
